* federal grant to city *



** Analysis
clear all
set more off

global work `"F:\fiscal research\mayor\grant"' 
cd "${work}"

use "F:\fiscal research\mayor\PSRM data\PSRM_fed_grant_city_FY2005_2021_analysis.dta", clear


log using "F:\fiscal research\mayor\PSRM data\PSRM_Analaysis_log"

** Log file for Analysis: Table 1, Table 2, Table B.4, Table B.5, Table B.6, Table B.7, Table B.8 **


xtset geo_fips year



* Table 1 (and Table B.4)
xtreg fed_act_yr_city_2012_pc i.mayor_pres_party ln_tot_pop ln_income_pc pov_rate i.year, fe vce(cluster geo_fips)
outreg2 using R1_final_fed_act_con_pc, tex drop(i.geo_fips i.year) ctitle("Total, Per capita (con $)") addnote("Note: clustered standard errors at city level.") addtext(City FE, YES, Year FE, YES) replace

xtreg fed_act_yr_city_2012_pc i.strong_mayor_pres_party ln_tot_pop ln_income_pc pov_rate i.year, fe vce(cluster geo_fips)
outreg2 using R1_final_fed_act_con_pc, tex drop(i.geo_fips i.year) ctitle("Total, Per capita (con $)") addnote("Note: clustered standard errors at city level.") addtext(City FE, YES, Year FE, YES) append

xtreg fed_act_yr_city_2012_pc i.mayor_pres_gover_party ln_tot_pop ln_income_pc pov_rate i.year, fe vce(cluster geo_fips)
outreg2 using R1_final_fed_act_con_pc, tex drop(i.geo_fips i.year) ctitle("Total, Per capita (con $)") addnote("Note: clustered standard errors at city level.") addtext(City FE, YES, Year FE, YES) append

xtreg fed_act_yr_city_2012_pc i.str_mayor_pres_gover_party ln_tot_pop ln_income_pc pov_rate i.year, fe vce(cluster geo_fips)
outreg2 using R1_final_fed_act_con_pc, tex drop(i.geo_fips i.year) ctitle("Total, Per capita (con $)") addnote("Note: clustered standard errors at city level.") addtext(City FE, YES, Year FE, YES) append



** Table 2 (and Table B.5): By President Party **
xtreg fed_act_yr_city_2012_pc i.mayor_pres_party ln_tot_pop ln_income_pc pov_rate i.year if pres_dem==1, fe vce(cluster geo_fips)
outreg2 using R1_final_fed_act_con_pc_presparty, tex drop(i.geo_fips i.year) ctitle("Total, Per capita (con $), Dem Pres") addnote("Note: clustered standard errors at city level.") addtext(City FE, YES, Year FE, YES) replace

xtreg fed_act_yr_city_2012_pc i.mayor_pres_party ln_tot_pop ln_income_pc pov_rate i.year if pres_dem==0, fe vce(cluster geo_fips)
outreg2 using R1_final_fed_act_con_pc_presparty, tex drop(i.geo_fips i.year) ctitle("Total, Per capita (con $), Rep Pres") addnote("Note: clustered standard errors at city level.") addtext(City FE, YES, Year FE, YES) append


xtreg fed_act_yr_city_2012_pc i.strong_mayor_pres_party ln_tot_pop ln_income_pc pov_rate i.year if pres_dem==1, fe vce(cluster geo_fips)
outreg2 using R1_final_fed_act_con_pc_presparty, tex drop(i.geo_fips i.year) ctitle("Total, Per capita (con $), Dem Pres") addnote("Note: clustered standard errors at city level.") addtext(City FE, YES, Year FE, YES) append

xtreg fed_act_yr_city_2012_pc i.strong_mayor_pres_party ln_tot_pop ln_income_pc pov_rate i.year if pres_dem==0, fe vce(cluster geo_fips)
outreg2 using R1_final_fed_act_con_pc_presparty, tex drop(i.geo_fips i.year) ctitle("Total, Per capita (con $), Rep Pres") addnote("Note: clustered standard errors at city level.") addtext(City FE, YES, Year FE, YES) append


xtreg fed_act_yr_city_2012_pc i.mayor_pres_gover_party ln_tot_pop ln_income_pc pov_rate i.year if pres_dem==1, fe vce(cluster geo_fips)
outreg2 using R1_final_fed_act_con_pc_presparty, tex drop(i.geo_fips i.year) ctitle("Total, Per capita (con $), Dem Pres") addnote("Note: clustered standard errors at city level.") addtext(City FE, YES, Year FE, YES) append

xtreg fed_act_yr_city_2012_pc i.mayor_pres_gover_party ln_tot_pop ln_income_pc pov_rate i.year if pres_dem==0, fe vce(cluster geo_fips)
outreg2 using R1_final_fed_act_con_pc_presparty, tex drop(i.geo_fips i.year) ctitle("Total, Per capita (con $), Rep Pres") addnote("Note: clustered standard errors at city level.") addtext(City FE, YES, Year FE, YES) append


xtreg fed_act_yr_city_2012_pc i.str_mayor_pres_gover_party ln_tot_pop ln_income_pc pov_rate i.year if pres_dem==1, fe vce(cluster geo_fips)
outreg2 using R1_final_fed_act_con_pc_presparty, tex drop(i.geo_fips i.year) ctitle("Total, Per capita (con $), Dem Pres") addnote("Note: clustered standard errors at city level.") addtext(City FE, YES, Year FE, YES) append

xtreg fed_act_yr_city_2012_pc i.str_mayor_pres_gover_party ln_tot_pop ln_income_pc pov_rate i.year if pres_dem==0, fe vce(cluster geo_fips)
outreg2 using R1_final_fed_act_con_pc_presparty, tex drop(i.geo_fips i.year) ctitle("Total, Per capita (con $), Rep Pres") addnote("Note: clustered standard errors at city level.") addtext(City FE, YES, Year FE, YES) append




** Addition **
** Table B.6 **

xtreg fed_act_yr_city_2012_pc i.mayor_pres_party##i.pres_dem c.ln_tot_pop#i.pres_dem c.ln_income_pc#i.pres_dem c.pov_rate#i.pres_dem i.year, fe vce(cluster geo_fips)
outreg2 using R1_final_fed_act_con_demdummy, tex drop(i.geo_fips i.year) ctitle("Total, Per capita (con $)") addnote("Note: clustered standard errors at city level.") addtext(City FE, YES, Year FE, YES) replace

xtreg fed_act_yr_city_2012_pc i.strong_mayor_pres_party##i.pres_dem c.ln_tot_pop#i.pres_dem c.ln_income_pc#i.pres_dem c.pov_rate#i.pres_dem i.year, fe vce(cluster geo_fips)
outreg2 using R1_final_fed_act_con_demdummy, tex drop(i.geo_fips i.year) ctitle("Total, Per capita (con $)") addnote("Note: clustered standard errors at city level.") addtext(City FE, YES, Year FE, YES) append

xtreg fed_act_yr_city_2012_pc i.mayor_pres_gover_party##i.pres_dem c.ln_tot_pop#i.pres_dem c.ln_income_pc#i.pres_dem c.pov_rate#i.pres_dem i.year, fe vce(cluster geo_fips)
outreg2 using R1_final_fed_act_con_demdummy, tex drop(i.geo_fips i.year) ctitle("Total, Per capita (con $)") addnote("Note: clustered standard errors at city level.") addtext(City FE, YES, Year FE, YES) append

xtreg fed_act_yr_city_2012_pc i.str_mayor_pres_gover_party##i.pres_dem c.ln_tot_pop#i.pres_dem c.ln_income_pc#i.pres_dem c.pov_rate#i.pres_dem i.year, fe vce(cluster geo_fips)
outreg2 using R1_final_fed_act_con_demdummy, tex drop(i.geo_fips i.year) ctitle("Total, Per capita (con $)") addnote("Note: clustered standard errors at city level.") addtext(City FE, YES, Year FE, YES) append



** Table B.7 **

xtreg ln_fed_act_yr_city_2012 i.mayor_pres_party ln_tot_pop ln_income_pc pov_rate i.year, fe vce(cluster geo_fips)
outreg2 using R1_final_fed_act_ln, tex drop(i.geo_fips i.year) ctitle("Total, Logged") addnote("Note: clustered standard errors at city level.") addtext(City FE, YES, Year FE, YES) replace

xtreg ln_fed_act_yr_city_2012 i.strong_mayor_pres_party ln_tot_pop ln_income_pc pov_rate i.year, fe vce(cluster geo_fips)
outreg2 using R1_final_fed_act_ln, tex drop(i.geo_fips i.year) ctitle("Total, Logged") addnote("Note: clustered standard errors at city level.") addtext(City FE, YES, Year FE, YES) append

xtreg ln_fed_act_yr_city_2012 i.mayor_pres_gover_party ln_tot_pop ln_income_pc pov_rate i.year, fe vce(cluster geo_fips)
outreg2 using R1_final_fed_act_ln, tex drop(i.geo_fips i.year) ctitle("Total, Logged") addnote("Note: clustered standard errors at city level.") addtext(City FE, YES, Year FE, YES) append

xtreg ln_fed_act_yr_city_2012 i.str_mayor_pres_gover_party ln_tot_pop ln_income_pc pov_rate i.year, fe vce(cluster geo_fips)
outreg2 using R1_final_fed_act_ln, tex drop(i.geo_fips i.year) ctitle("Total, Logged") addnote("Note: clustered standard errors at city level.") addtext(City FE, YES, Year FE, YES) append



** Table B.8 **
xtreg ln_fed_act_yr_city_2012 i.mayor_pres_party ln_tot_pop ln_income_pc pov_rate i.year if pres_dem==1, fe vce(cluster geo_fips)
outreg2 using R1_final_fed_act_ln_presparty, tex drop(i.geo_fips i.year) ctitle("Total, Logged, Dem Pres") addnote("Note: clustered standard errors at city level.") addtext(City FE, YES, Year FE, YES) replace

xtreg ln_fed_act_yr_city_2012 i.mayor_pres_party ln_tot_pop ln_income_pc pov_rate i.year  if pres_dem==0, fe vce(cluster geo_fips)
outreg2 using R1_final_fed_act_ln_presparty, tex drop(i.geo_fips i.year) ctitle("Total, Logged, Rep Pres") addnote("Note: clustered standard errors at city level.") addtext(City FE, YES, Year FE, YES) append


xtreg ln_fed_act_yr_city_2012 i.strong_mayor_pres_party ln_tot_pop ln_income_pc pov_rate i.year if pres_dem==1, fe vce(cluster geo_fips)
outreg2 using R1_final_fed_act_ln_presparty, tex drop(i.geo_fips i.year) ctitle("Total, Logged, Dem Pres") addnote("Note: clustered standard errors at city level.") addtext(City FE, YES, Year FE, YES) append

xtreg ln_fed_act_yr_city_2012 i.strong_mayor_pres_party ln_tot_pop ln_income_pc pov_rate i.year if pres_dem==0, fe vce(cluster geo_fips)
outreg2 using R1_final_fed_act_ln_presparty, tex drop(i.geo_fips i.year) ctitle("Total, Logged, Rep Pres") addnote("Note: clustered standard errors at city level.") addtext(City FE, YES, Year FE, YES) append


xtreg ln_fed_act_yr_city_2012 i.mayor_pres_gover_party ln_tot_pop ln_income_pc pov_rate i.year if pres_dem==1, fe vce(cluster geo_fips)
outreg2 using R1_final_fed_act_ln_presparty, tex drop(i.geo_fips i.year) ctitle("Total, Logged, Dem Pres") addnote("Note: clustered standard errors at city level.") addtext(City FE, YES, Year FE, YES) append

xtreg ln_fed_act_yr_city_2012 i.mayor_pres_gover_party ln_tot_pop ln_income_pc pov_rate i.year if pres_dem==0, fe vce(cluster geo_fips)
outreg2 using R1_final_fed_act_ln_presparty, tex drop(i.geo_fips i.year) ctitle("Total, Logged, Rep Pres") addnote("Note: clustered standard errors at city level.") addtext(City FE, YES, Year FE, YES) append


xtreg ln_fed_act_yr_city_2012 i.str_mayor_pres_gover_party ln_tot_pop ln_income_pc pov_rate i.year if pres_dem==1, fe vce(cluster geo_fips)
outreg2 using R1_final_fed_act_ln_presparty, tex drop(i.geo_fips i.year) ctitle("Total, Logged, Dem Pres") addnote("Note: clustered standard errors at city level.") addtext(City FE, YES, Year FE, YES) append

xtreg ln_fed_act_yr_city_2012 i.str_mayor_pres_gover_party ln_tot_pop ln_income_pc pov_rate i.year if pres_dem==0, fe vce(cluster geo_fips)
outreg2 using R1_final_fed_act_ln_presparty, tex drop(i.geo_fips i.year) ctitle("Total, Logged, Rep Pres") addnote("Note: clustered standard errors at city level.") addtext(City FE, YES, Year FE, YES) append

log close
 
translate "F:\fiscal research\mayor\PSRM data\PSRM_Analaysis_log.smcl" "F:\fiscal research\mayor\PSRM data\PSRM_Analaysis_log.pdf" 

 
